<?php
if (!defined('BASEPATH'))
    exit('No direct script access allowed');
/**
 * View file: header
 *
 * @author luubk
 * @since 10-06-2012 - 00:54:39
 */
?>
<header id="header">
    <hgroup>
        <h1 class="site_title"><a href="<?php echo site_url() ?>"><?php echo SITE_TITLE ?></a></h1>
        <h2 class="section_title"><?php echo isset($title) ? $title : '' ?></h2>
        <div class="btn_view_site"><a href="http://hoanguyen.info">View Site</a></div>
    </hgroup>
</header> <!-- end of header bar -->

<section id="secondary_bar">
    <div class="user">
        <?php if ($this->session->userdata('loggedin')): ?>
            <p><?php echo $this->session->userdata('u_name') ?> (<a href="#">3 Tin nhắn</a>)</p>
            <a class="logout_user" href="<?php echo site_url('user/logout') ?>" title="Thoát">Thoát</a> 
        <?php else: ?>
            <p>                
                <a href="<?php echo site_url('user/login') ?>" title="Đăng nhập">Đăng nhập</a> 
            </p>
        <?php endif; ?>
    </div>
    <div class="breadcrumbs_container">
        <article class="breadcrumbs">
            <a href="<?php echo site_url() ?>"><?php echo SITE_TITLE ?></a> 
            <div class="breadcrumb_divider"></div>            
            
            <?php $module = $this->uri->segment(1) ?>            
            <?php if (!empty($menu_list[$module])): ?>                
                <a href="<?php echo site_url($module)?>/index"><?php echo 'Danh sách '.$menu_list[$module]['name'] ?></a>
                <div class="breadcrumb_divider"></div>                
            <?php endif; ?>
                
            <?php $small_module = $this->uri->segment(2) ?>                
            <?php // if($small_module != '' && $small_module != 'form' && $small_module != 'index'): ?>                
            <?php if($small_module == 'chapter'): ?>                
                <a href="<?php echo site_url($module) ?>/form/<?php echo $_GET[$module.'_id']?>">
                    <?php echo $_GET[$module.'_name']?>
                </a>
                <div class="breadcrumb_divider"></div>                
            <?php endif; ?>
                
            <?php if($small_module == 'movieEpisode'): ?>                
                <a href="<?php echo site_url($module) ?>/form/<?php echo $_GET[$module.'_id'].'?creator='.$_GET['creator']?>">
                    <?php echo $_GET[$module.'_name']?>
                </a>
                <div class="breadcrumb_divider"></div>                
            <?php endif; ?>
                
            <a class="current"><?php echo $title ?></a>
        </article>
    </div>
</section><!-- end of secondary bar -->